import React from 'react'
import { Swiper, Toast, Image } from 'antd-mobile'

// import { Banner } from '../GetServerData/index';
export default function MySwiper(props) {

    return (
        <div>
            <Swiper
                loop
                autoplay
            // onIndexChange={i => {
            //     console.log(i, 'onIndexChange1')
            // }}
            >
                    {props.bannerList.map((item, index) => {
                        return (
                            <Swiper.Item key={index}>
                                <div
                                    className='content'
                                    onClick={() => {
                                        Toast.show(`你点击了卡片 ${index + 1}`)
                                    }}
                                >
                                    <Image src={item.url} fit="fill" />
                                </div>
                            </Swiper.Item>
                        )
                    })}

            </Swiper>
        </div>
    )
}
